package dame3;
class Mythread extends Thread{
    public void run(){
        while (true) {
            System.out.println("thred");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
public class Test {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Mythread();
        t.start();
        while (true) {
            System.out.println("thred");
            Thread.sleep(1000);
        }
     }
    }

